home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.3 KB | 223 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Illustrator.vu
- #
- # Contains: Quick look test script for Adobe Illustrator version 3.2
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: Kevin Avoy
- # Description: Sets up tools and fonts for Illustrator. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- #########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kLinePaletteNum := 0;
- global kPatternPaletteNum := 0;
- global kColorPaletteNum := 2;
-
- global gLineWeights := {};
-
- global gWindowInset := {0,20,20,20}; # Window inset
- global gScreenInset := {33,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gTextStr;
- global gDocumentWindow := 0;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {0, 39, 28, 324}, # Location of palette absolute Coordinates
- kPalDocWind, # Palette type
- {1,16}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,18} # Offset between tools {h,v}
- } #### End Palette #1
- };
-
-
- ### Illustrator {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global ArrowTool := { 1, 1, "Arrow", kClick, 0, {0}};
- global ZoomTool := { 2, 1, "Zoom", kClick, 0, {0}};
- global CharTool := { 3, 1, "Character", kDrag, 0, {gTextStr}};
- global Freehand := { 4, 1, "Freehand", kMultiDrag, 0, {0}};
-
- global PenTool := { 5, 1, "Pen", kMultiClick,1, {0}};
- global RectTool := { 6, 1, "Rectangle", kDrag, 0, {0}};
- global OvalTool := { 7, 1, "Oval", kDrag, 0, {0}};
- global BlendTool := { 8, 1, "Blend", kDragClick, 0, {0}};
-
- global ScaleTool := { 9, 1, "Scale", kDragClick, 0, {0}};
- global RotateTool := { 10, 1, "Rotate", kDragClick, 0, {0}};
- global ReflectTool := { 11, 1, "Reflect", kDragClick, 0, {0}};
- global ShearTool := { 12, 1, "Shear", kDragClick, 0, {0}};
-
- global SplitPathTool := { 13, 1, "SplitPath", kClick, 0, {0}};
- global MeasureTool := { 14, 1, "Measure", kDragClick, 0, {0}};
- global PageTool := { 15, 1, "Page", kClick, 0, {0}};
- global GraphTool := { 16, 1, "Graph", kDrag, 0, {0}};
-
-
- # global Tool list
- global gToolList:={ ArrowTool,
- ZoomTool,
- CharTool,
- Freehand,
-
- PenTool,
- RectTool,
- OvalTool,
- #BlendTool,
-
- ScaleTool,
- RotateTool,
- ReflectTool,
- ShearTool,
-
- #SplitPathTool,
- #MeasureTool,
- PageTool
- #GraphTool
- };
-
- ### font characteristic lists
- global gFontList := {'Helvetica'}; # Has only Helvetica as menuitem
- global gFontSizeList := {'7','8','9','10','12','14','18', '24','36','48','72'};
- global gFontStyleList := {}; # Does not have Styles as a menuitem
- global gCurrFontMenu := FindMenu(gFontList[1]); # Put this here since SetFont uses hard coded Chicago
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := ""; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; # InitAppGlobals
-
- #########################################################################
- # DoTextIllustrator()
- #========================================================================
- # Author: KTA
- # Description: Test fonts in Illustrator.
- # Parameters: None
- # Returns: Nada
- # Examples: DoTextIllustrator();
- # Assumptions: Illustrator
- #========================================================================
- # History:
- #
- #########################################################################
- task DoTextIllustrator()
- begin
- Draw(global CharTool,,0,0,0,0);
- wait(3);
- DoText();
- SpecialKey(EnterKey, "EnterKey");
- end;
-
- #########################################################################
- # IllustratorScrapText()
- #========================================================================
- # Author: KTA
- # Description: Test scraptext in Illustrator.
- # Parameters: None
- # Returns: Nada
- # Examples: IllustratorScrapText();
- # Assumptions: Illustrator
- #========================================================================
- # History:
- #
- #########################################################################
- task IllustratorScrapText()
- begin
- Draw(global CharTool,,0,0,0,0);
- wait(3);
- ScrapBook(global kScrapText);
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Illustrator (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- global gAppTitle := 'Adobe Illustrator'; # Title of app you will be running
- global gAppVersion := '3'; # version of app you will be running
- SuiteStart('Illustrator.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gFileName := "@!@-{gBuildVers}-Illustrator"; # This is used in NameOK when saving files
- global gCustomScrapText := task IllustratorScrapText; # hook for custom scraptext in DoSetUpApp
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(,,,"None N",1,,1); # Illustrator doesn't accept Picts from scrap
- DoDraw();
- DoTextIllustrator();
- DoWindow();
- DoCloseApp();
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: Illustrator doesn't accept pict from scrap");
- LogStr("NOTE: Fonts other than 'Helvetica' and all styles are only contained
- within dialog boxes so not tested in DoText");
- LogStr("NOTE: Illustrator doesn't support revert");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script Canvas
-
- ### What's Needed
- # 1) Insure that Palette is up and in the left corner or the screen
- # 2) Insure that Drawing window does not cover any portion of the palette
- # 3) Insure that Pointer tool is selected after DoText before DoWindow
- # 4) Illustrator doesn't accept text or Picts from scrap
- # 6) Fonts and Styles are only contained within dialog boxes
- # 7) DoTextIllustrator is called/ need to set up global check so text tool isn't always selected.
- # 8) Palette is really palette of popups
-
-